package com.tourism.user.cn.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tourism.core.cn.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/*********************************************************************
 Copyright(c) 2025 All Rights Reserved .
 Author : liliang
 CreatedOn : 2025/1/2 19:41
 Email : 2061996582@qq.com
 Describe : TODO
 UseCase :
 Version : 2025|V1.0.0.0
 **********************************************************************/
@Mapper
public interface IUserMapper extends BaseMapper<User>{
    /**
     * 根据手机号查询用户
     */
    @Select("SELECT * FROM t_user WHERE mobile = #{mobile} AND is_deleted = 0")
    User selectByMobile(@Param("mobile") String mobile);

    /**
     * 根据用户名查询用户
     */
    @Select("SELECT * FROM t_user WHERE username = #{username} AND is_deleted = 0")
    User selectByUserName(@Param("username") String username);

}
